package video.background.Utils;

import java.nio.charset.StandardCharsets;
import java.util.Base64;

public class Encrypt {
    static public String numEncrypt(String number) {
        try{
            //加密
//            byte[] encryptedBytes = Base64.getEncoder().encode(number.getBytes(StandardCharsets.UTF_8));
            byte[] encryptedBytes = Base64.getMimeEncoder().encode(number.getBytes(StandardCharsets.UTF_8));
            String encryptedData = new String(encryptedBytes, StandardCharsets.UTF_8);
            return encryptedData;
        }catch (Exception e){
            e.printStackTrace();
            return "加密错误";
        }
    }
}
